<style>
    

</style>

    <div class="modal fade" id="updateDBModal" tabindex="-1" role="dialog" aria-labelledby="updateDBModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                        &times;
                    </button>
                    <h4 class="modal-title" id="updateDBModalLabel">
                        修改数据库配置
                    </h4>
                </div>
                    <div class="modal-body">
                        <form id="update_db_info" class="main form-horizontal">
                            <fieldset>
                                <input class="form-control" name="update_db_server" id="update_db_server" style="display: none;">
                                <div class="form-group col-sm-12">
                                    <label for="update_db_asset_nu" class="col-sm-3 control-label">资产编号/资产名称<span class="text-red">*</span></label>
                                    <div class="col-sm-9">
                                        <input type="text" class="form-control" name="update_db_asset_nu" id="update_db_asset_nu" disabled/>
                                    </div>
                                </div>

                                <div class="form-group col-sm-12">
                                    <label for="update_db_IP" class="col-sm-3 control-label">IP地址<span class="text-red">*</span></label>
                                    <div class="col-sm-9">
                                        <input type="text" class="form-control" name="update_db_IP" id="update_db_IP" disabled/>
                                    </div>
                                </div>

                                <div class="form-group col-sm-12">
                                    <label for="update_db_type" class="col-sm-3 control-label">数据库类型<span class="text-red">*</span></label>
                                    <div class="col-sm-9">
                                        <select class="form-control select2" name="update_db_type"
                                                id="update_db_type" style="width: 100%;" disabled>
                                            {% for db_type in db_type_ %}
                                                <option value="{{ db_type.0 }}">{{ db_type.1 }}</option>
                                            {% endfor %}
                                        </select>
                                    </div>
                                </div>

                                <div class="form-group col-sm-12" style="display: none;">
                                        <label for="update_db_oracle_type" class="col-sm-3 control-label">连接类型<span class="text-red">*</span></label>
                                        <div class="col-sm-9">
                                            <select class="form-control" name="update_db_oracle_type"
                                                    id="update_db_oracle_type" style="width: 100%;" onchange="dbOracleUpdateType();">
                                                {% for db_oracle_type in db_oracle_type_ %}
                                                    <option value="{{ db_oracle_type.0 }}">{{ db_oracle_type.1 }}</option>
                                                {% endfor %}
                                            </select>
                                        </div>
                                    </div>

                                <div class="form-group col-sm-12">
                                    <label for="update_db_port" class="col-sm-3 control-label">数据库端口<span class="text-red">*</span></label>
                                    <div class="col-sm-9">
                                        <input type="number" class="form-control" name="update_db_port" min="1" max="99999" oninput="if(this.value=='0'){this.value='';}else{this.value=this.value.replace(/[^0-9]/g,'')};if(this.value.length>5){this.value=this.value.slice(0,5)}"
                                               id="update_db_port"/>
                                    </div>
                                </div>

                                <div class="form-group col-sm-12">
                                    <label for="update_db_name" class="col-sm-3 control-label">数据库名称/实例名</label>
                                    <div class="col-sm-9">
                                        <input type="text" class="form-control" name="update_db_name"
                                               id="update_db_name"/>
                                    </div>
                                </div>

                                <div class="form-group col-sm-12">
                                    <label for="update_db_user" class="col-sm-3 control-label">数据库账号<span class="text-red">*</span></label>
                                    <div class="col-sm-9">
                                        <input type="text" class="form-control" name="update_db_user"
                                               id="update_db_user"/>
                                    </div>
                                </div>

                                <div class="form-group col-sm-12">
                                    <label for="update_db_code" class="col-sm-3 control-label">数据库编码</label>
                                    <div class="col-sm-9">
                                        <input type="text" class="form-control" name="update_db_code"
                                               id="update_db_code" placeholder="例如：utf8"/>
                                    </div>
                                </div>

                                <div class="form-group col-sm-12">
                                    <label for="update_db_belong_user" class="col-sm-3 control-label">所属用户</label>
                                    <div class="col-sm-9">
                                        <select class="form-control select2" id="update_db_belong_user"
                                                multiple="multiple" name="update_db_belong_user"
                                                style="width: 100%;">
                                            {% for user in users %}
                                                <option value="{{ user.id }}">{{ user.username }}</option>
                                            {% endfor %}
                                        </select>
                                    </div>
                                </div>

                                <div class="form-group col-sm-12">
                                    <label for="update_db_group" class="col-sm-3 control-label">使用组</label>
                                    <div class="col-sm-9">
                                        <select class="form-control select2" name="update_db_group" multiple
                                                id="update_db_group" style="width: 100%;">
                                            {% for group in groups %}
                                                <option value="{{ group.id }}">{{ group.name }}</option>
                                            {% endfor %}
                                        </select>
                                    </div>
                                </div>

                                <div class="form-group col-sm-12">
                                    <label for="update_db_memo" class="col-sm-3 control-label">备注</label>
                                    <div class="col-sm-9">
                                    <textarea class="form-control" name="update_db_memo"
                                              id="update_db_memo"></textarea>
                                    </div>
                                </div>
                            </fieldset>
                        </form>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                        <button type="button" class="btn btn-primary" id="update_db_ops">修改</button>
                    </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal -->
    </div>

<script>
    
</script>